package com.tanhua.server.controller;

import com.tanhua.server.service.BaiduService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 上报地理位置控制层
 */
@RestController
@RequestMapping("/baidu")
public class BaiduController {

    @Autowired
    private BaiduService baiduService;

    /**
     * 上报地理位置
     */
    @RequestMapping(value = "/location",method = RequestMethod.POST)
    public ResponseEntity reportLocation(@RequestBody Map<String,Object> params){
        Double longitude = (Double) params.get("longitude");//经度
        Double latitude = (Double) params.get("latitude");//纬度
        String addrStr = (String) params.get("addrStr");//纬度
        //baiduService.reportLocation(longitude,latitude,addrStr);
        return ResponseEntity.ok(null);
    }
}
